package com.ruiben.mall.vo;

import java.util.List;
import java.util.Objects;

public class SpecBean {
    /**
     * label : 这是可选值
     * id : 180806827T8NMKD4
     * attrInputType : 1
     * children : [{"id":"180806827T8NMKD4","typeId":"1","attrName":"这是可选值","attrInputType":1,"attrType":1,"sortOrder":2,"attrValues":"这是可选值","valueStr":"这是可选值","productAttrId":null,"values":["这是可选值"],"type":{"id":"180806827T8NMKD4","catName":"书","enabled":null},"add":false,"price":"12"}]
     */

    private String label;
    private String id;
    private int attrInputType;
    private List<ChildrenBean> children;

    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public int getAttrInputType() {
        return attrInputType;
    }

    public void setAttrInputType(int attrInputType) {
        this.attrInputType = attrInputType;
    }

    public List<ChildrenBean> getChildren() {
        return children;
    }

    public void setChildren(List<ChildrenBean> children) {
        this.children = children;
    }

    public static class ChildrenBean {
        /**
         * id : 180806827T8NMKD4
         * typeId : 1
         * attrName : 这是可选值
         * attrInputType : 1
         * attrType : 1
         * sortOrder : 2
         * attrValues : 这是可选值
         * valueStr : 这是可选值
         * productAttrId : null
         * values : ["这是可选值"]
         * type : {"id":"180806827T8NMKD4","catName":"书","enabled":null}
         * add : false
         * price : 12
         */

        private String id;
        private String typeId;
        private String attrName;
        private int attrInputType;
        private int attrType;
        private int sortOrder;
        private String attrValues;
        private String valueStr;
        private Object productAttrId;
        private TypeBean type;
        private boolean add;
        private String price;
        private List<String> values;

        public String getId() {
            return id;
        }

        public void setId(String id) {
            this.id = id;
        }

        public String getTypeId() {
            return typeId;
        }

        public void setTypeId(String typeId) {
            this.typeId = typeId;
        }

        public String getAttrName() {
            return attrName;
        }

        public void setAttrName(String attrName) {
            this.attrName = attrName;
        }

        public int getAttrInputType() {
            return attrInputType;
        }

        public void setAttrInputType(int attrInputType) {
            this.attrInputType = attrInputType;
        }

        public int getAttrType() {
            return attrType;
        }

        public void setAttrType(int attrType) {
            this.attrType = attrType;
        }

        public int getSortOrder() {
            return sortOrder;
        }

        public void setSortOrder(int sortOrder) {
            this.sortOrder = sortOrder;
        }

        public String getAttrValues() {
            return attrValues;
        }

        public void setAttrValues(String attrValues) {
            this.attrValues = attrValues;
        }

        public String getValueStr() {
            return valueStr;
        }

        public void setValueStr(String valueStr) {
            this.valueStr = valueStr;
        }

        public Object getProductAttrId() {
            return productAttrId;
        }

        public void setProductAttrId(Object productAttrId) {
            this.productAttrId = productAttrId;
        }

        public TypeBean getType() {
            return type;
        }

        public void setType(TypeBean type) {
            this.type = type;
        }

        public boolean isAdd() {
            return add;
        }

        public void setAdd(boolean add) {
            this.add = add;
        }

        public String getPrice() {
            return price;
        }

        public void setPrice(String price) {
            this.price = price;
        }

        public List<String> getValues() {
            return values;
        }

        public void setValues(List<String> values) {
            this.values = values;
        }




        public static class TypeBean {
            /**
             * id : 180806827T8NMKD4
             * catName : 书
             * enabled : null
             */

            private String id;
            private String catName;
            private Object enabled;

            public String getId() {
                return id;
            }

            public void setId(String id) {
                this.id = id;
            }

            public String getCatName() {
                return catName;
            }

            public void setCatName(String catName) {
                this.catName = catName;
            }

            public Object getEnabled() {
                return enabled;
            }

            public void setEnabled(Object enabled) {
                this.enabled = enabled;
            }

            @Override
            public boolean equals(Object o) {
                if (this == o) return true;
                if (o == null || getClass() != o.getClass()) return false;
                TypeBean typeBean = (TypeBean) o;
                return Objects.equals(id, typeBean.id) &&
                        Objects.equals(catName, typeBean.catName) &&
                        Objects.equals(enabled, typeBean.enabled);
            }

            @Override
            public int hashCode() {
                return Objects.hash(id, catName, enabled);
            }
        }

        @Override
        public boolean equals(Object o) {
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;
            ChildrenBean that = (ChildrenBean) o;
            return attrInputType == that.attrInputType &&
                    attrType == that.attrType &&
                    sortOrder == that.sortOrder &&
                    add == that.add &&
                    Objects.equals(id, that.id) &&
                    Objects.equals(typeId, that.typeId) &&
                    Objects.equals(attrName, that.attrName) &&
                    Objects.equals(attrValues, that.attrValues) &&
                    Objects.equals(valueStr, that.valueStr) &&
                    Objects.equals(productAttrId, that.productAttrId) &&
                    Objects.equals(type, that.type) &&
                    Objects.equals(price, that.price) &&
                    Objects.equals(values, that.values);
        }

        @Override
        public int hashCode() {
            return Objects.hash(id, typeId, attrName, attrInputType, attrType, sortOrder, attrValues, valueStr, productAttrId, type, add, price, values);
        }
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        SpecBean specBean = (SpecBean) o;
        return attrInputType == specBean.attrInputType &&
                Objects.equals(label, specBean.label) &&
                Objects.equals(id, specBean.id) &&
                Objects.equals(children, specBean.children);
    }

    @Override
    public int hashCode() {
        return Objects.hash(label, id, attrInputType, children);
    }
}
